﻿<UserControl x:Class="Oxage.Views.MainView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:c="clr-namespace:Oxage"
	xmlns:v="clr-namespace:Oxage.Views"
	xmlns:m="clr-namespace:Oxage.Models">
  <UserControl.DataContext>
    <m:MainViewModel />
  </UserControl.DataContext>
  <Grid x:Name="LayoutRoot">
    <DockPanel>

      <!-- Menu -->
      <Menu DockPanel.Dock="Top" ToolBar.OverflowMode="Never">
        <MenuItem Header="File">
          <MenuItem Header="New" Command="{Binding DocumentCommand}" CommandParameter="New" InputGestureText="Ctrl+N" />
          <MenuItem Header="Open..." Command="{Binding DocumentCommand}" CommandParameter="Open" InputGestureText="Ctrl+O" />
          <MenuItem Header="Save" Command="{Binding DocumentCommand}" CommandParameter="Save" InputGestureText="Ctrl+S" />
          <MenuItem Header="Save As..." Command="{Binding DocumentCommand}" CommandParameter="SaveAs" />
          <Separator />
          <MenuItem Header="Import..." Command="{Binding DocumentCommand}" CommandParameter="Import" />
          <MenuItem Header="Export..." Command="{Binding DocumentCommand}" CommandParameter="Export" />
          <Separator />
          <MenuItem Header="Exit" Command="{Binding ApplicationCommand}" CommandParameter="Exit" />
        </MenuItem>
        <MenuItem Header="Edit">
          <MenuItem Header="Undo" Command="{Binding EditCommand}" CommandParameter="Undo" InputGestureText="Ctrl+Z" />
          <MenuItem Header="Redo" Command="{Binding EditCommand}" CommandParameter="Redo" InputGestureText="Ctrl+Y" />
          <Separator />
          <MenuItem Header="Cut" Command="{Binding EditCommand}" CommandParameter="Cut" InputGestureText="Ctrl+X" />
          <MenuItem Header="Copy" Command="{Binding EditCommand}" CommandParameter="Copy" InputGestureText="Ctrl+C" />
          <MenuItem Header="Paste" Command="{Binding EditCommand}" CommandParameter="Paste" InputGestureText="Ctrl+V" />
          <MenuItem Header="Delete" Command="{Binding EditCommand}" CommandParameter="Delete" InputGestureText="Del" />
          <Separator />
          <MenuItem Header="Find..." Command="{Binding EditCommand}" CommandParameter="FindText" InputGestureText="Ctrl+F" />
          <MenuItem Header="Find next" Command="{Binding EditCommand}" CommandParameter="FindNext" InputGestureText="F3" />
          <MenuItem Header="Replace..." Command="{Binding EditCommand}" CommandParameter="ReplaceText" InputGestureText="Ctrl+H" />
          <MenuItem Header="Jump to line..." Command="{Binding EditCommand}" CommandParameter="JumpToLine" InputGestureText="Ctrl+G" />
        </MenuItem>
        <MenuItem Header="Build">
          <MenuItem Header="Run Code Analysis" Command="{Binding DebugCommand}" CommandParameter="CheckCode" InputGestureText="Ctrl+Shift+B" />
        </MenuItem>
        <MenuItem Header="Machine">
          <MenuItem Header="Run" Command="{Binding DebugCommand}" CommandParameter="Start" InputGestureText="F5" />
          <MenuItem Header="Stop" Command="{Binding DebugCommand}" CommandParameter="Stop" InputGestureText="Shift+F5" />
          <Separator />
          <MenuItem Header="Step" Command="{Binding DebugCommand}" CommandParameter="Step" InputGestureText="F11" />
          <MenuItem Header="Break" Command="{Binding DebugCommand}" CommandParameter="Break" />
          <MenuItem Header="Continue" Command="{Binding DebugCommand}" CommandParameter="Continue" InputGestureText="F5" />
          <Separator />
          <MenuItem Header="Toggle Breakpoint" Command="{Binding DebugCommand}" CommandParameter="Breakpoint" InputGestureText="F9" />
          <MenuItem Header="Delete All Breakpoints" Command="{Binding DebugCommand}" CommandParameter="DeleteAllBreakpoints" InputGestureText="Ctrl+Shift+F9" />
          <Separator />
          <!--<MenuItem Header="Calibration" Command="{Binding ApplicationCommand}" CommandParameter="MachineCalibrate" />-->
          <MenuItem Header="Configuration..." Command="{Binding ApplicationCommand}" CommandParameter="MachineConfig" />
        </MenuItem>
        <MenuItem Header="Simulator">
          <MenuItem Header="Show" Command="{Binding SimulatorCommand}" CommandParameter="Window" />
          <MenuItem Header="Refresh" Command="{Binding SimulatorCommand}" CommandParameter="QuickDraw" InputGestureText="Ctrl+R" />
          <MenuItem Header="Clear" Command="{Binding SimulatorCommand}" CommandParameter="Clear" />
        </MenuItem>
        <MenuItem Header="Tools">
          <MenuItem Header="Options..." Command="{Binding ApplicationCommand}" CommandParameter="Options" />
        </MenuItem>
        <MenuItem Header="Window">
          <MenuItem Header="Editor" Command="{Binding WindowCommand}" CommandParameter="TextEditor" IsCheckable="True" IsChecked="True" />
          <MenuItem Header="Simulator" Command="{Binding WindowCommand}" CommandParameter="Simulator" IsCheckable="True" IsChecked="True" />
          <MenuItem Header="Watch" Command="{Binding WindowCommand}" CommandParameter="Watch" IsCheckable="True" IsChecked="True" />
          <MenuItem Header="Logger" Command="{Binding WindowCommand}" CommandParameter="Logger" IsCheckable="True" IsChecked="True" />
          <MenuItem Header="Transform" Command="{Binding WindowCommand}" CommandParameter="Transform" IsCheckable="True" IsChecked="True" />
          <MenuItem Header="Manual Control" Command="{Binding WindowCommand}" CommandParameter="ManualControl" IsCheckable="True" IsChecked="True" />
        </MenuItem>
        <MenuItem Header="Help">
          <MenuItem Header="Index" Command="{Binding ApplicationCommand}" CommandParameter="Help" />
          <MenuItem Header="About" Command="{Binding ApplicationCommand}" CommandParameter="About" />
        </MenuItem>
      </Menu>
    
      <!-- Content -->
      <Grid Margin="5">
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition Height="3*" />
          <RowDefinition Height="1*" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="1">
          <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3*" />
            <ColumnDefinition Width="1*" />
          </Grid.ColumnDefinitions>
        
          <!-- Left -->
          <TabControl Grid.Column="0" Margin="0,0,2,0">
            <TabItem Header="Editor">
              <v:EditorView x:Name="Editor" Document="{Binding Document}" />
            </TabItem>
            <TabItem Header="Console">
              <v:ConsoleView />
            </TabItem>
          </TabControl>
        
          <!-- Splitter -->
          <GridSplitter Grid.Column="0" Width="2" Background="#FF333333" />
        
          <!-- Right -->
          <TabControl Grid.Column="1" Margin="0,0,0,0">
            <TabItem Header="Simulator">
              <v:SimulatorView x:Name="Simulator" />
            </TabItem>
            <!--<TabItem Header="Watch">
              <v:WatchView x:Name="Watch" />
            </TabItem>
            <TabItem Header="Config">
              <v:ConfigView x:Name="Config" />
            </TabItem>-->
            <TabItem Header="Manual">
              <v:ManualView x:Name="Control" />
            </TabItem>
            <TabItem Header="Transform">
              <v:TransformView x:Name="Transform" />
            </TabItem>
          </TabControl>
        </Grid>
      
        <!-- Splitter -->
        <GridSplitter Grid.Row="1" Height="2" ResizeDirection="Rows" Background="#FF333333" />

        <Grid Grid.Row="2">
          <v:LogView x:Name="Log" Margin="0,2,0,0" />
        </Grid>

      </Grid>

    </DockPanel>
  </Grid>
</UserControl>
